#include <stdio.h>

int main0()
{
    FILE *p = fopen("a1.txt", "r");
    while(1)
    {
        char name[100] = { 0 };
        int age = 0;
        fscanf(p, "姓名=%s,年龄=%d", name, &age);
        if(feof(p))
            break;
        printf("%s, %d\n", name, age);
    }
    fclose(p);
    return 0;
}


int main()
{
    FILE *p = fopen("a1.txt", "r");

    while(1)
    {
        char buf[100] = { 0 };
        int age = 0;
        //char name[100] = { 0 };

        fgets(buf, sizeof(buf), p);

        if (feof(p))
            break;

        //sscanf(buf, "姓名=%s,年龄=%d", name,  &age);
        sscanf(buf, "年龄=%d", &age);
        //printf("%s, %d\n", name,  age);
        printf("%d\n", age);
    }
    fclose(p);
    return 0;


}
